Skip to content

Run the RabbitMQ integration tests against a real broker - #221

Merged
ndevenish merged 2 commits into
pika-publisher-confirmsfrom
test-rabbitmq-broker
Nov 6, 2026
Merged

ndevenish merged 2 commits into
pika-publisher-confirmsfrom
test-rabbitmq-broker

Conversation

@ndevenish

Copy link
Copy Markdown
Contributor

The pika transport tests that need a broker were always skipped, both locally and in CI, as nothing provided one.

Add a session rabbitmq_broker fixture that uses, in order: RABBITMQ_HOST/RABBITMQ_PORT if set, an existing broker on localhost:5672, or a temporary rabbitmq:3 container started with docker or podman. If no broker can be found or started the tests are skipped locally, but fail when CI is set, so that they can't silently stop running again.

Add a rabbitmq service to the GitHub Actions test job.

@ndevenish
ndevenish added this pull request to stack #222 November 6, 2026 16:25
Comment thread tests/transport/conftest.py Fixed
The pika transport tests that need a broker were always skipped,
both locally and in CI, as nothing provided one.

Add a session rabbitmq_broker fixture that uses, in order:
RABBITMQ_HOST/RABBITMQ_PORT if set, an existing broker on
localhost:5672, or a temporary rabbitmq:3 container started with
docker or podman. If no broker can be found or started the tests
are skipped locally, but fail when CI is set, so that they can't
silently stop running again.

Add a rabbitmq service to the GitHub Actions test job.
Resolves a CodeQL 'potentially uninitialized local variable' alert. The
previous code was correct, as _no_broker() never returns, but CodeQL
doesn't follow NoReturn.
@ndevenish
ndevenish force-pushed the test-rabbitmq-broker branch from dce283d to d9cacb0 Compare November 6, 2026 16:52
@ndevenish
ndevenish merged commit 376924d into main Nov 6, 2026
8 checks passed
@ndevenish
ndevenish deleted the test-rabbitmq-broker branch November 6, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants